/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.next.muscu;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 *
 * @author sdelporte
 */
public class PersistanceUnitTools {
    static EntityManagerFactory emf = BuildPersistanceUnit();
    
    private static EntityManagerFactory BuildPersistanceUnit()
    {   
            return Persistence.createEntityManagerFactory("MusculationProgramPU" );
    }
    
    public static EntityManagerFactory getEntityManagerFactory()
    {
        return emf;
    }
    
    public static EntityManager getOneEntityManager()
    {
        return emf.createEntityManager();
    }
}
